package com.wkk.log.entity;

import com.baomidou.mybatisplus.annotation.*;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.experimental.Accessors;
import org.springframework.format.annotation.DateTimeFormat;

import java.io.Serializable;
import java.util.Date;

/**
 * @author : WangKeKe
 * @date : 2020/9/28 15:21
 * Description : 用于记录用户操作日志
 */

@Data
@Accessors(chain = true)
@ApiModel(description = "用于记录用户操作日志")
@TableName("log_operation")
public class UserOperation implements Serializable {

    private static final long serialVersionUID = 1L;

    @TableId(type = IdType.ASSIGN_ID)
    @ApiModelProperty(value = "主键")
    private String id;

    @ApiModelProperty(value = "操作者用户名")
    private String username;

    @ApiModelProperty(value = "操作内容")
    private String operation;

    @ApiModelProperty(value = "接口方法 路径+方法名")
    private String method;

    @ApiModelProperty(value = "操作参数信息")
    private String params;

    @ApiModelProperty(value = "操作耗时")
    private Long time;

    @ApiModelProperty(value = "操作者IP地址")
    private String ip;

    @TableField(fill = FieldFill.INSERT)
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @ApiModelProperty(value = "创建时间")
    private Date createTime;

    @ApiModelProperty(value = "操作是否成功 true成功 false失败")
    private String status;

    @ApiModelProperty(value = "逻辑删除 0-正常 1-删除")
    private Integer deleted;
}
